home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1996 #15
/
Monster Media Number 15 (Monster Media)(July 1996).ISO
/
prog_c
/
cuj0696.zip
/
DWYER.ZIP
/
COUPON.TST
/
CHIONCHI.AWK
< prev
next >
Wrap
Text File
|
1995-09-24
|
490b
|
24 lines
BEGIN\
{
LoIdx = 11111;
HiIdx = -1;
}
/^ChiSqPct/{\
++ItmCnt;
Idx = int($3)+1;
if (Idx < LoIdx) LoIdx = Idx;
if (Idx > HiIdx) HiIdx = Idx;
++PctCnt[Idx];
}
END{\
for (i = 1; i <= 100; ++i)
{
# ChiSqValu += (PctCnt[i] - ItmCnt/100)^2;
ChiSqValu += PctCnt[i]^2;
}
# ChiSqValu /= ItmCnt/100.0;
ChiSqValu = ChiSqValu * 100/ItmCnt - ItmCnt;
printf("LoIdx = %d, HiIdx = %d\n", LoIdx, HiIdx);
printf("No. Vals = %d, Chi Square = %f\n", ItmCnt, ChiSqValu);
}